package com.che.software.testato.domain.entity.creation;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.che.software.testato.domain.entity.Intention;
import com.che.software.testato.domain.entity.MapArrow;

/**
 * Class representing the properties of a script to be created.
 * 
 * @author Clement HELIOU (clement.heliou@che-software.com).
 * @copyright Che Software.
 * @license GNU General Public License.
 * @see Serializable
 * @since July, 2011.
 * 
 *        This file is part of Testato.
 * 
 *        Testato is free software: you can redistribute it and/or modify it
 *        under the terms of the GNU General Public License as published by the
 *        Free Software Foundation, either version 3 of the License, or (at your
 *        option) any later version.
 * 
 *        Testato is distributed in the hope that it will be useful, but WITHOUT
 *        ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 *        FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
 *        for more details.
 * 
 *        You should have received a copy of the GNU General Public License
 *        along with Testato. If not, see <http://www.gnu.org/licenses/>.
 * 
 *        Testato's logo is a creation of Arrioch
 *        (http://arrioch.deviantart.com/) and it's distributed under the terms
 *        of the Creative Commons License.
 */
public class ScriptCreation implements Serializable {

	/**
	 * Constants.
	 */
	private static final long serialVersionUID = 2554967509975014584L;

	/**
	 * Members.
	 */
	private List<Intention> scriptIntentions = new ArrayList<Intention>();
	private List<MapArrow> scriptArrows = new ArrayList<MapArrow>();

	/**
	 * Default builder.
	 */
	public ScriptCreation() {
	}

	/**
	 * Builder from fields.
	 * 
	 * @param scriptIntentions the script intentions.
	 */
	private ScriptCreation(List<Intention> scriptIntentions, List<MapArrow> scriptArrows) {
		super();
		this.scriptArrows = scriptArrows;
		this.scriptIntentions = scriptIntentions;
	}

	/**
	 * Builder from an object to clone.
	 * 
	 * @param toClone the object to clone.
	 */
	public ScriptCreation(ScriptCreation toClone) {
		this(new ArrayList<Intention>(toClone.getScriptIntentions()), new ArrayList<MapArrow>(toClone.getScriptArrows()));
	}

	/**
	 * Adds an arrow to the script.
	 * 
	 * @author Clement HELIOU (clement.heliou@che-software.com).
	 * @param arrow the arrow to add.
	 * @since July, 2011.
	 */
	public void addArrow(MapArrow arrow) {
		scriptArrows.add(arrow);
	}

	/**
	 * Adds an intention to the script.
	 * 
	 * @author Clement HELIOU (clement.heliou@che-software.com).
	 * @param intention the intention to add.
	 * @since July, 2011.
	 */
	public void addIntention(Intention intention) {
		scriptIntentions.add(intention);
	}

	/**
	 * Getter for the private field value scriptIntentions.
	 * 
	 * @return the scriptIntentions field value.
	 */
	public List<Intention> getScriptIntentions() {
		return scriptIntentions;
	}

	/**
	 * Setting a value to the scriptIntentions field.
	 * 
	 * @param scriptIntentions the value to set.
	 */
	public void setScriptIntentions(List<Intention> scriptIntentions) {
		this.scriptIntentions = scriptIntentions;
	}

	/**
	 * Getter for the private field value scriptArrows.
	 * 
	 * @return the scriptArrows field value.
	 */
	public List<MapArrow> getScriptArrows() {
		return scriptArrows;
	}

	/**
	 * Setting a value to the scriptArrows field.
	 * 
	 * @param scriptArrows the value to set.
	 */
	public void setScriptArrows(List<MapArrow> scriptArrows) {
		this.scriptArrows = scriptArrows;
	}
}